<!DOCTYPE html>
<html class="x-admin-sm">
    <head>
        <meta charset="UTF-8">
        <title>欢迎页面-X-admin2.2</title>
        <meta name="renderer" content="webkit">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
        <link rel="stylesheet" href="../../css/font.css">
        <link rel="stylesheet" href="../../css/xadmin.css">
        <script type="text/javascript" src="../../lib/layui/layui.js" charset="utf-8"></script>
        <script type="text/javascript" src="../../js/xadmin.js"></script>
        <script src="../../js/base.js" type="text/javascript" charset="utf-8"></script>
        <!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
        <!--[if lt IE 9]>
            <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
            <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
        <![endif]-->
    </head>

    <body>
        <div class="layui-fluid">
            <div class="layui-row">
                <form class="layui-form" lay-filter="example">
                    <div class="layui-form-item">
                        
                        
                            <div class="layui-form-item">
                            	<label for="L_username" class="layui-form-label">
                            		<span class="x-red">*</span>BSC1级分类
                            	</label>
                            	<div class="layui-input-inline">
                            		
                            		<input type="text" id="type_2" disabled="disabled" name="type_2" required="" autocomplete="off" class="layui-input">
                            	</div>
                            	<label for="L_username" class="layui-form-label">
                            		<span class="x-red">*</span>BSC2级分类
                            	</label>
                            	<div class="layui-input-inline">
									<input type="text" id="type_3" disabled="disabled" name="type_3" required="" autocomplete="off" class="layui-input">
                            	</div>
                            </div>
                            <div class="layui-form-item">
                            	<label for="L_username" class="layui-form-label">
                            		<span class="x-red">*</span>级别:
                            	</label>
                            	<div class="layui-input-inline">
                            		
                            		
									<input type="text" id="type_1" disabled="disabled" name="type_1" required="" autocomplete="off" class="layui-input">
                            	</div>
                            	<label for="L_username" class="layui-form-label">
                            		<span class="x-red">*</span>表达式</label>
                            	<div class="layui-input-inline">
                            		
                            		<select lay-filter="isexpress" id="isexpress" name="isexpress" lay-verify="required" lay-search="">
                            			<option value="1">是</option>
                            			<option value="0">否</option>
                            		</select>
                            	</div>
                            	
                            </div>
                            <div class="layui-form-item">
                            	<label for="L_username" class="layui-form-label">
                            		<span class="x-red">*</span>指标代码</label>
                            	<div class="layui-input-inline">
                            		<input type="text" id="guide_code" disabled="disabled" name="guide_code" required="" autocomplete="off" class="layui-input">
                            	</div>
                            	<label for="L_username" class="layui-form-label">
                            		<span class="x-red">*</span>指标名称</label>
                            	<div class="layui-input-inline">
                            		<input type="text" id="guide_name" name="guide_name" required="" autocomplete="off" class="layui-input">
                            	</div>
                            </div>
                            
                            
                            <div class="layui-form-item">
                            	<label for="L_username" class="layui-form-label">
                            		<span class="x-red">*</span>指标表达式</label>
                            	<div class="layui-input-block">
                            		<textarea rows="" cols="" id="guide_express" name="guide_express" placeholder="请输入指标表达式" class="layui-textarea"></textarea>
                            	</div>
                            </div>
                            
                            <div class="layui-form-item">
                            	<label for="L_username" class="layui-form-label">
                            		<span class="x-red">*</span>停用状态</label>
                            	<div class="layui-input-inline">
                            		<select lay-filter="ispage" id="ispage" name="ispage" lay-verify="required" lay-search="">
                            			<option value="1">是</option>
                            			<option value="0">否</option>
                            		</select>
                            	</div>
                            	<label for="L_username" class="layui-form-label">
                            		<span class="x-red">*</span>高优指标</label>
                            	<div class="layui-input-inline">
                            		<select lay-filter="ishighguide" id="ishighguide" name="ishighguide" lay-verify="required" lay-search="">
                            			<option value="1">是</option>
                            			<option value="0">否</option>
                            		</select>
                            	</div>
                            </div>
                            
                            <div class="layui-form-item">
                            	<label for="L_username" class="layui-form-label">
                            		<span class="x-red">*</span>综合评价指标</label>
                            	<div class="layui-input-inline">
                            		<select id="issel" name="issel" class="layui-input">
                            			<option value="1">是</option>
                            			<option value="0">否</option>
                            		</select>
                            		
                            	</div>
                            	<div class="layui-input-inline">
                            		<label for="L_username" class="layui-form-label">
                            			<span class="x-red"></span></label>
                            		<button class="layui-btn select" lay-filter="save" lay-submit="">保存</button>
                            	</div>
                            	
                            </div>
						</div>
                </form>
            </div>
        </div>
        <script>
            layui.use(["form", "layer","laydate"],
                function() {
                    $ = layui.jquery;
                    var form = layui.form,
                        layer = layui.layer;
						laydate = layui.laydate;
						
						laydate.render({
						    elem: '#dept_date',
							type: 'datetime'
						});
						  
                    var guide_code = get("guide_code");
                    
					$.post(root+"Zhibiaoweihu/get_one", {
					        guide_code: guide_code
					    },
					    function(data) {
							if(data.data.isexpress == 0)
							{
								$("#guide_express").val("");
								$("#guide_express").attr("disabled",true);
							}
					        form.val("example", data.data);
					    }
					);
					
					
					form.on('select(isexpress)', function(adata) {
						var value = adata.value;
						if(value == 0)
						{
							$("#guide_express").val("");
							$("#guide_express").attr("disabled",true);
						}
						if(value == 1)
						{
							$("#guide_express").attr("disabled",false);
						}
					});
					
                    //监听提交
                    form.on("submit(save)",
                        function(data) {
                            console.log(data.field);
                            
                            $.post(root+"Zhibiaoweihu/save_one",
                            data.field,
                            function(data){
                                if(data.code == 0)
                                {
                                    layer.alert(data.msg, {
                                        icon: 6
                                    });
                                    xadmin.close();
                                    xadmin.father_reload();
                                }
                                else
                                {
                                    layer.alert(data.msg, {
                                        icon: 2
                                    });
                                }
                            });
                            
                            return false;
                        });
						
					form.on('select(account_dept_code)', function(data){
					  console.log($("#account_dept_code").find("option:selected").text());
					  $("#account_dept_name").val($("#account_dept_code").find("option:selected").text());
					});
                });
        </script>
        <script>
            var _hmt = _hmt || [];
            (function() {
                var hm = document.createElement("script");
                hm.src = "https://hm.baidu.com/hm.js?b393d153aeb26b46e9431fabaf0f6190";
                var s = document.getElementsByTagName("script")[0];
                s.parentNode.insertBefore(hm, s);
            })();
        </script>
    </body>

</html>


